package com.liu.model;

import org.json.JSONException;
import org.json.JSONObject;

public class Group {
	private String UUID, name, jyUUID;
	private int status = -99;

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getUUID() {
		return UUID;
	}

	public String getJyUUID() {
		return jyUUID;
	}

	public void setJyUUID(String jyUUID) {
		this.jyUUID = jyUUID;
	}

	public void setUUID(String uUID) {
		UUID = uUID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public JSONObject toJsonObj() throws JSONException {
		JSONObject obj = new JSONObject();
		obj.put("name", getName());
		obj.put("jyUUID", getJyUUID());
		obj.put("UUID", getUUID());
		obj.put("status", status);
		return obj;
	}
	
	public static Group JsonToGroup(JSONObject obj ) throws JSONException{
		Group ac = new Group();
		ac.setUUID(obj.getString("UUID"));
		ac.setName(obj.getString("name"));
		ac.setJyUUID(obj.getString("jyUUID"));
		ac.setStatus(obj.getInt("status"));
		return ac;
	}
}
